<?php
$_doc = array();
$_doc['title'] = L('tab_content_list');
$_doc['extra'] = '<link rel="stylesheet" type="text/css" href="'.__CURRENT__.'/index.css" />';
?>
<include file="pAdmin:header" />
<script type="text/javascript" src="<?php echo __CURRENT__;?>/index.js"></script>
<script type="text/javascript">
    var _loc_ = "__URL__/index";
    //var _loc_no_typeid_ = _loc_.replace(/(\/)?category[=\/]\d*/,'');
    function writeTypelink(typenames,typeids){
        var tns = typenames.split(',');
        var ids = typeids.split(',');
        for(var i=0,len=tns.length;i<len;i++){
            document.write('<a href="'+_loc_+'&category='+ids[i]+'"/>'+tns[i]+'</a>');
        }
    }
    //var _loc_no_poster_ = _loc_.replace(/\/?poster[=\/][\w_]+/,'');
    function writePosterlink(poster){
        document.write('<a href="'+_loc_+'&poster='+poster+'"/>'+poster+'</a>');
    }
</script>
<table class="tabmenu" cellspacing="0">
    <tbody>
        <tr>
            <td class="wedge">&nbsp;</td>
            <td class="wmenu here"><a href="__URL__/index"><span>{%tab_content_list}</span></a></td>
            <td class="wmenu"><a href="__URL__/add"><span>{%tab_content_add}</span></a></td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>
<div class="main">
    <ul class="fnc">
        <li class="page">{$page}</li>
    </ul>
    <form name="mainForm" method="post" action="__URL__">
        <input type="hidden" name="a">
        <table class="data" id="gridInst">
            <thead>
                <tr>
                    <th class="cbCell roundedleft"><input type="checkbox" id="effectAll" /></th>
                    <th>{%column_title}</th>
                    <th>{%column_category}</th>
                    <th>{%column_status}</th>
                    <th>{%column_publisher}</th>
                    <th class="roundedright">{%column_created}</th>
                </tr>
            </thead>
            <tbody id="postbody" class="grid">
                <present name="list">
                    <iterate name="list" id="vo">
                        <tr>
                            <td><input type="checkbox" name="id[]" value="{$vo['id']}"/></td>
                            <td class="posttitle {$vo['status']}">
                                <b>{$vo['title']}</b>
                                <ul>
                                    <li><a href="__URL__/edit/post/{$vo['id']}">编辑</a></li>
                                    <li><a href="__URL__/removal/post/{$vo['id']}">删除</a></li>
                                </ul>
                            </td>
                            <td class="typeid"><script type="text/javascript">writeTypelink("{$vo['typename']}","{$vo['typeid']}")</script></td>
                            <td><?php echo L('post_'.$vo['status']);?></td>
                            <td><script type="text/javascript">writePosterlink("{$vo['poster']}")</script></td>
                            <td class="created">{$vo['created']}</td>
                        </tr>
                    </iterate>
                <else/>
                    <tr class="notfound">
                        <td colspan="20">没有记录</td>
                    </tr>
                </present>
            </tbody>
        </table>
    </form>
    <ul class="fnc">
        <li class="page">{$page}</li>
    </ul>
</div>
<include file="pAdmin:footer" />